﻿<%@ Page Language="VB" MasterPageFile="~/HelpDesk.master" AutoEventWireup="false"
    CodeFile="Tickets.aspx.vb" Inherits="Admin_Tickets" Title="Tickets" Theme="HelpDesk"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1>
        <asp:Literal ID="Literal2" runat="server" meta:resourcekey="Literal2Resource1" Text="Tickets"></asp:Literal>
    </h1>
    <table width="100%">
        <tr>
            <td width="50%">
                <a href="TicketsForm.aspx">
                    <img src="../Images/Icones/bug_add.png" alt="" />
                    <asp:Literal ID="Literal1" runat="server" meta:resourcekey="Literal1Resource1" Text="Nouveau ticket"></asp:Literal>
                </a>
            </td>
            <td align="right" width="50%">
                <asp:RadioButtonList ID="RadioButtonListResolution" runat="server" AutoPostBack="True"
                    RepeatDirection="Horizontal" RepeatLayout="Flow" meta:resourcekey="RadioButtonListResolutionResource1">
                    <asp:ListItem Selected="True" Value="0" Text="Ouverts" meta:resourcekey="ListItemResource1"></asp:ListItem>
                    <asp:ListItem Value="1" Text="Ferm&#233;s" meta:resourcekey="ListItemResource2"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlTickets" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
        SelectCommand="SELECT Ticket.ticket_id, Ticket.ticket_auteur, Ticket.ticket_sujet, Ticket.ticket_resolu, Ticket.ticket_date, Ticket.ticket_datemodification, Priorite.priorite_label, TypeTicket.typeticket_label, Projet.projet_nom, (SELECT COUNT(*) - 1 AS nb FROM Commentaire WHERE (ticket_id = Ticket.ticket_id)) AS nbCommentaires FROM Ticket INNER JOIN Projet ON Ticket.projet_id = Projet.projet_id INNER JOIN Priorite ON Ticket.priorite_id = Priorite.priorite_id INNER JOIN TypeTicket ON Ticket.typeticket_id = TypeTicket.typeticket_id WHERE (Ticket.ticket_resolu = @ticket_resolu) ORDER BY Priorite.priorite_ordre, Ticket.ticket_datemodification DESC, Ticket.ticket_date DESC">
        <SelectParameters>
            <asp:ControlParameter ControlID="RadioButtonListResolution" Name="ticket_resolu"
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridViewTickets" runat="server" AutoGenerateColumns="False" DataKeyNames="ticket_id"
        DataSourceID="SqlTickets" meta:resourcekey="GridViewTicketsResource1">
        <Columns>
            <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ticket_id", "TicketsForm.aspx?ticket_id={0}") %>'
                        meta:resourcekey="HyperLink1Resource1">
                        <img src="../Images/Icones/bug_edit.png" alt="" />
                    </asp:HyperLink>
                </ItemTemplate>
                <ItemStyle Width="16px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Sujet" SortExpression="ticket_sujet" meta:resourcekey="TemplateFieldResource2">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ticket_id", "TicketsForm.aspx?ticket_id={0}") %>'
                        Text='<%# Eval("ticket_sujet") %>' meta:resourcekey="HyperLink1Resource2"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="projet_nom" HeaderText="Projet" SortExpression="projet_nom"
                meta:resourcekey="BoundFieldResource1" />
            <asp:BoundField DataField="ticket_date" HeaderText="Date" SortExpression="ticket_date"
                DataFormatString="{0:d}" meta:resourcekey="BoundFieldResource2" />
            <asp:BoundField DataField="priorite_label" HeaderText="Priorit&#233;" SortExpression="priorite_label"
                meta:resourcekey="BoundFieldResource3" />
            <asp:BoundField DataField="typeticket_label" HeaderText="Type" SortExpression="typeticket_label"
                meta:resourcekey="BoundFieldResource4" />
            <asp:BoundField DataField="nbCommentaires" HeaderText="Comm." SortExpression="nbCommentaires"
                meta:resourcekey="BoundFieldResource5" />
        </Columns>
    </asp:GridView>
</asp:Content>
